-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
.prettierrc.cjs
93 lines (93 loc) · 2.21 KB
/
.prettierrc.cjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/** @type {import('prettier').Config} */
module.exports = {
// pre-commit.ci fails without `require.resolve()`.
plugins: [
require.resolve('prettier-plugin-sort-json'),
require.resolve('prettier-plugin-toml'),
],
semi: false,
singleQuote: true,
trailingComma: 'all',
jsonRecursiveSort: true,
jsonSortOrder: JSON.stringify({
'/^[^\\d+]/': 'none',
'/^\\d+/': 'none',
}),
overrides: [
{
files: '*.jsonc',
options: {
trailingComma: 'none',
},
},
{
files: 'src/api/json/catalog.json',
options: {
jsonRecursiveSort: true,
jsonSortOrder: JSON.stringify({
$schema: null,
version: null,
name: null,
description: null,
fileMatch: null,
url: null,
versions: null,
// Set to "none" to prevent lexical sorting of version strings.
'/^[^\\d+]/': 'none',
'/^\\d+/': 'none',
}),
},
},
{
files: 'src/schema-validation.jsonc',
options: {
jsonRecursiveSort: true,
jsonSortOrder: JSON.stringify({
$schema: null,
$id: null,
$comment: null,
ajvNotStrictMode: null,
fileMatchConflict: null,
highSchemaVersion: null,
missingCatalogUrl: null,
skiptest: null,
catalogEntryNoLintNameOrDescription: null,
options: null,
externalSchema: null,
unknownKeywords: null,
unknownFormat: null,
'/^[^\\d+]/': null,
'/^\\d+/': null,
}),
},
},
{
files: 'src/{test,negative_test}/**',
options: {
jsonRecursiveSort: true,
jsonSortOrder: JSON.stringify({
'/^[^\\d+]/': null,
'/^\\d+/': null,
}),
},
},
{
files: 'src/schemas/json/**',
options: {
jsonRecursiveSort: true,
jsonSortOrder: JSON.stringify({
$schema: null,
$id: null,
$comment: null,
$ref: null,
'/^\\$.*/': null,
'/^[^\\d+]/': 'none',
'/^\\d+/': 'none',
if: null,
then: null,
else: null,
}),
},
},
],
}