File tree Expand file tree Collapse file tree 3 files changed +51
-12
lines changed Expand file tree Collapse file tree 3 files changed +51
-12
lines changed Original file line number Diff line number Diff line change 16
16
"extends" : [" plugin:jsonc/recommended-with-jsonc" ],
17
17
"files" : [" *.json" ],
18
18
"parser" : " jsonc-eslint-parser" ,
19
+ "rules" : {
20
+ "jsonc/sort-keys" : [" warn" ],
21
+ "notice/notice" : " off"
22
+ }
23
+ },
24
+ {
25
+ "extends" : [" plugin:jsonc/recommended-with-jsonc" ],
26
+ "files" : [" package.json" ],
27
+ "parser" : " jsonc-eslint-parser" ,
19
28
"rules" : {
20
29
"jsonc/sort-keys" : [
21
30
" warn" ,
65
74
" cpu" ,
66
75
" publishConfig"
67
76
],
68
- "pathPattern" : " .* " // Hits the all properties
77
+ "pathPattern" : " ^$ " // Top-level properties
69
78
},
70
79
{
80
+ /*
81
+ * This rule excludes export conditions from alphabetical sorting.
82
+ * Since node.js processes export conditions in order and chooses the
83
+ * first match, they need to be ordered logically, not alphabetically.
84
+ */
71
85
"order" : { "type" : " asc" },
72
- "pathPattern" : " .*"
86
+ "pathPattern" : " ^(?!exports \\ [) .*" // All properties except export conditions
73
87
}
74
- ],
75
- "notice/notice" : " off"
88
+ ]
76
89
}
77
90
},
78
91
{
Original file line number Diff line number Diff line change 134
134
"extends" : [" plugin:jsonc/recommended-with-jsonc" ],
135
135
"files" : [" *.json" ],
136
136
"parser" : " jsonc-eslint-parser" ,
137
+ "rules" : {
138
+ "jsonc/sort-keys" : [" warn" ],
139
+ "notice/notice" : " off"
140
+ }
141
+ },
142
+ {
143
+ "extends" : [" plugin:jsonc/recommended-with-jsonc" ],
144
+ "files" : [" package.json" ],
145
+ "parser" : " jsonc-eslint-parser" ,
137
146
"rules" : {
138
147
"jsonc/sort-keys" : [
139
148
" warn" ,
183
192
" cpu" ,
184
193
" publishConfig"
185
194
],
186
- "pathPattern" : " .* " // Hits the all properties
195
+ "pathPattern" : " ^$ " // Top-level properties
187
196
},
188
197
{
198
+ /*
199
+ * This rule excludes export conditions from alphabetical sorting.
200
+ * Since node.js processes export conditions in order and chooses the
201
+ * first match, they need to be ordered logically, not alphabetically.
202
+ */
189
203
"order" : { "type" : " asc" },
190
- "pathPattern" : " .*"
204
+ "pathPattern" : " ^(?!exports \\ [) .*" // All properties except export conditions
191
205
}
192
- ],
193
- "notice/notice" : " off"
206
+ ]
194
207
}
195
208
}
196
209
]
Original file line number Diff line number Diff line change 127
127
"extends" : [" plugin:jsonc/recommended-with-jsonc" ],
128
128
"files" : [" *.json" ],
129
129
"parser" : " jsonc-eslint-parser" ,
130
+ "rules" : {
131
+ "jsonc/sort-keys" : [" warn" ],
132
+ "notice/notice" : " off"
133
+ }
134
+ },
135
+ {
136
+ "extends" : [" plugin:jsonc/recommended-with-jsonc" ],
137
+ "files" : [" package.json" ],
138
+ "parser" : " jsonc-eslint-parser" ,
130
139
"rules" : {
131
140
"jsonc/sort-keys" : [
132
141
" warn" ,
176
185
" cpu" ,
177
186
" publishConfig"
178
187
],
179
- "pathPattern" : " .* " // Hits the all properties
188
+ "pathPattern" : " ^$ " // Top-level properties
180
189
},
181
190
{
191
+ /*
192
+ * This rule excludes export conditions from alphabetical sorting.
193
+ * Since node.js processes export conditions in order and chooses the
194
+ * first match, they need to be ordered logically, not alphabetically.
195
+ */
182
196
"order" : { "type" : " asc" },
183
- "pathPattern" : " .*"
197
+ "pathPattern" : " ^(?!exports \\ [) .*" // All properties except export conditions
184
198
}
185
- ],
186
- "notice/notice" : " off"
199
+ ]
187
200
}
188
201
}
189
202
]
You can’t perform that action at this time.
0 commit comments