1package eslint
2
3import "list"
4
5// JSON schema for ESLint configuration files
6#Schema: {
7 @jsonschema(schema="http://json-schema.org/draft-07/schema#")
8 @jsonschema(id="https://json.schemastore.org/eslintrc.json")
9
10 // By default, ESLint supports only ECMAScript 5 syntax. You can override that
11 // setting to enable support for ECMAScript 6 as well as JSX by using
12 // configuration settings.
13 ecmaFeatures?: _#defs."/properties/ecmaFeatures"
14
15 // An environment defines global variables that are predefined.
16 env?: _#defs."/properties/env"
17 extends?: #stringOrStringArray
18
19 // Set each global variable name equal to true to allow the variable to be
20 // overwritten or false to disallow overwriting.
21 globals?: _#defs."/properties/globals"
22
23 // Prevent comments from changing config or rules
24 noInlineConfig?: bool
25
26 // Report unused eslint-disable comments
27 reportUnusedDisableDirectives?: bool
28 parser?: _#defs."/properties/parser"
29
30 // The JavaScript language options to be supported
31 parserOptions?: _#defs."/properties/parserOptions"
32
33 // ESLint supports the use of third-party plugins. Before using the plugin, you
34 // have to install it using npm.
35 plugins?: _#defs."/properties/plugins"
36
37 // By default, ESLint will look for configuration files in all parent folders up
38 // to the root directory. This can be useful if you want all of your projects
39 // to follow a certain convention, but can sometimes lead to unexpected
40 // results. To limit ESLint to a specific project, set this to `true` in a
41 // configuration in the root of your project.
42 root?: bool
43 ignorePatterns?: #stringOrStringArray
44
45 // ESLint comes with a large number of rules. You can modify which rules your
46 // project uses either using configuration comments or configuration files.
47 rules?: _#defs."/properties/rules"
48
49 // ESLint supports adding shared settings into configuration file. You can add
50 // settings object to ESLint configuration file and it will be supplied to
51 // every rule that will be executed. This may be useful if you are adding
52 // custom rules and want them to have access to the same information and be
53 // easily configurable.
54 settings?: _#defs."/properties/settings"
55
56 // Allows to override configuration for files and folders, specified by glob patterns
57 overrides?: _#defs."/properties/overrides"
58
59 #bestPractices: {
60 "accessor-pairs"?: #rule
61 "array-callback-return"?: #rule
62 "block-scoped-var"?: #rule
63 "class-methods-use-this"?: #rule
64 complexity?: #rule
65 "consistent-return"?: #rule
66 curly?: #rule
67 "default-case"?: #rule
68 "dot-location"?: #rule
69 "dot-notation"?: #rule
70 eqeqeq?: #rule
71 "guard-for-in"?: #rule
72 "no-alert"?: #rule
73 "no-caller"?: #rule
74 "no-case-declarations"?: #rule
75 "no-div-regex"?: #rule
76 "no-else-return"?: #rule
77 "no-empty-function"?: #rule
78 "no-empty-pattern"?: #rule
79 "no-eq-null"?: #rule
80 "no-eval"?: #rule
81 "no-extend-native"?: #rule
82 "no-extra-bind"?: #rule
83 "no-extra-label"?: #rule
84 "no-fallthrough"?: #rule
85 "no-floating-decimal"?: #rule
86 "no-global-assign"?: #rule
87 "no-implicit-coercion"?: #rule
88 "no-implicit-globals"?: #rule
89 "no-implied-eval"?: #rule
90 "no-invalid-this"?: #rule
91 "no-iterator"?: #rule
92 "no-labels"?: #rule
93 "no-lone-blocks"?: #rule
94 "no-loop-func"?: #rule
95 "no-magic-numbers"?: #rule
96 "no-multi-spaces"?: #rule
97 "no-multi-str"?: #rule
98 "no-native-reassign"?: #rule
99 "no-new"?: #rule
100 "no-new-func"?: #rule
101 "no-new-wrappers"?: #rule
102 "no-octal"?: #rule
103 "no-octal-escape"?: #rule
104 "no-param-reassign"?: #rule
105 "no-proto"?: #rule
106 "no-redeclare"?: #rule
107 "no-restricted-properties"?: #rule
108 "no-return-assign"?: #rule
109 "no-return-await"?: #rule
110 "no-script-url"?: #rule
111 "no-self-assign"?: #rule
112 "no-self-compare"?: #rule
113 "no-sequences"?: #rule
114 "no-throw-literal"?: #rule
115 "no-unmodified-loop-condition"?: #rule
116 "no-unused-expressions"?: #rule
117 "no-unused-labels"?: #rule
118 "no-useless-call"?: #rule
119 "no-useless-concat"?: #rule
120 "no-useless-escape"?: #rule
121 "no-useless-return"?: #rule
122 "no-void"?: #rule
123 "no-warning-comments"?: #rule
124 "no-with"?: #rule
125 "prefer-promise-reject-errors"?: #rule
126 radix?: #rule
127 "require-await"?: #rule
128 "vars-on-top"?: #rule
129 "wrap-iife"?: #rule
130 yoda?: #rule
131 ...
132 }
133
134 #ecmaScript6: {
135 "arrow-body-style"?: #rule
136 "arrow-parens"?: #rule
137 "arrow-spacing"?: #rule
138 "constructor-super"?: #rule
139 "generator-star-spacing"?: #rule
140 "no-class-assign"?: #rule
141 "no-confusing-arrow"?: #rule
142 "no-const-assign"?: #rule
143 "no-dupe-class-members"?: #rule
144 "no-duplicate-imports"?: #rule
145 "no-new-symbol"?: #rule
146 "no-restricted-imports"?: #rule
147 "no-this-before-super"?: #rule
148 "no-useless-computed-key"?: #rule
149 "no-useless-constructor"?: #rule
150 "no-useless-rename"?: #rule
151 "no-var"?: #rule
152 "object-shorthand"?: #rule
153 "prefer-arrow-callback"?: #rule
154 "prefer-const"?: #rule
155 "prefer-destructuring"?: #rule
156 "prefer-numeric-literals"?: #rule
157 "prefer-reflect"?: #rule
158 "prefer-rest-params"?: #rule
159 "prefer-spread"?: #rule
160 "prefer-template"?: #rule
161 "require-yield"?: #rule
162 "rest-spread-spacing"?: #rule
163 "sort-imports"?: #rule
164 "symbol-description"?: #rule
165 "template-curly-spacing"?: #rule
166 "yield-star-spacing"?: #rule
167 ...
168 }
169
170 #legacy: {
171 "max-depth"?: #rule
172 "max-len"?: #rule
173 "max-params"?: #rule
174 "max-statements"?: #rule
175 "no-bitwise"?: #rule
176 "no-plusplus"?: #rule
177 ...
178 }
179
180 #nodeAndCommonJs: {
181 "callback-return"?: #rule
182 "global-require"?: #rule
183 "handle-callback-err"?: #rule
184 "no-buffer-constructor"?: #rule
185 "no-mixed-requires"?: #rule
186 "no-new-require"?: #rule
187 "no-path-concat"?: #rule
188 "no-process-env"?: #rule
189 "no-process-exit"?: #rule
190 "no-restricted-modules"?: #rule
191 "no-sync"?: #rule
192 ...
193 }
194
195 #possibleErrors: {
196 "comma-dangle"?: #rule
197 "for-direction"?: #rule
198 "getter-return"?: #rule
199 "no-await-in-loop"?: #rule
200 "no-compare-neg-zero"?: #rule
201 "no-cond-assign"?: #rule
202 "no-console"?: #rule
203 "no-constant-condition"?: #rule
204 "no-control-regex"?: #rule
205 "no-debugger"?: #rule
206 "no-dupe-args"?: #rule
207 "no-dupe-keys"?: #rule
208 "no-duplicate-case"?: #rule
209 "no-empty"?: #rule
210 "no-empty-character-class"?: #rule
211 "no-ex-assign"?: #rule
212 "no-extra-boolean-cast"?: #rule
213 "no-extra-parens"?: #rule
214 "no-extra-semi"?: #rule
215 "no-func-assign"?: #rule
216 "no-inner-declarations"?: #rule
217 "no-invalid-regexp"?: #rule
218 "no-irregular-whitespace"?: #rule
219 "no-negated-in-lhs"?: #rule
220 "no-obj-calls"?: #rule
221 "no-prototype-builtins"?: #rule
222 "no-regex-spaces"?: #rule
223 "no-sparse-arrays"?: #rule
224 "no-template-curly-in-string"?: #rule
225 "no-unexpected-multiline"?: #rule
226 "no-unreachable"?: #rule
227 "no-unsafe-finally"?: #rule
228 "no-unsafe-negation"?: #rule
229 "use-isnan"?: #rule
230 "valid-jsdoc"?: #rule
231 "valid-typeof"?: #rule
232 ...
233 }
234
235 #rule: matchN(1, [int & >=0 & <=2, "off" | "warn" | "error", [...]])
236
237 #strictMode: {
238 strict?: #rule
239 ...
240 }
241
242 #stringOrStringArray: matchN(1, [string, [...string]])
243
244 #stylisticIssues: {
245 "array-bracket-newline"?: #rule
246 "array-bracket-spacing"?: #rule
247 "array-element-newline"?: #rule
248 "block-spacing"?: #rule
249 "brace-style"?: #rule
250 camelcase?: #rule
251 "capitalized-comments"?: #rule
252 "comma-dangle"?: #rule
253 "comma-spacing"?: #rule
254 "comma-style"?: #rule
255 "computed-property-spacing"?: #rule
256 "consistent-this"?: #rule
257 "eol-last"?: #rule
258 "func-call-spacing"?: #rule
259 "func-name-matching"?: #rule
260 "func-names"?: #rule
261 "func-style"?: #rule
262 "function-call-argument-newline"?: #rule
263 "function-paren-newline"?: #rule
264 "id-blacklist"?: #rule
265 "id-length"?: #rule
266 "id-match"?: #rule
267 "implicit-arrow-linebreak"?: #rule
268 indent?: #rule
269 "indent-legacy"?: #rule
270 "jsx-quotes"?: #rule
271 "key-spacing"?: #rule
272 "keyword-spacing"?: #rule
273 "line-comment-position"?: #rule
274 "lines-between-class-members"?: #rule
275 "linebreak-style"?: #rule
276 "lines-around-comment"?: #rule
277 "lines-around-directive"?: #rule
278 "max-depth"?: #rule
279 "max-len"?: #rule
280 "max-lines"?: #rule
281 "max-nested-callbacks"?: #rule
282 "max-params"?: #rule
283 "max-statements"?: #rule
284 "max-statements-per-line"?: #rule
285 "multiline-comment-style"?: #rule
286 "multiline-ternary"?: #rule
287 "new-cap"?: #rule
288 "newline-after-var"?: #rule
289 "newline-before-return"?: #rule
290 "newline-per-chained-call"?: #rule
291 "new-parens"?: #rule
292 "no-array-constructor"?: #rule
293 "no-bitwise"?: #rule
294 "no-continue"?: #rule
295 "no-inline-comments"?: #rule
296 "no-lonely-if"?: #rule
297 "no-mixed-operators"?: #rule
298 "no-mixed-spaces-and-tabs"?: #rule
299 "no-multi-assign"?: #rule
300 "no-multiple-empty-lines"?: #rule
301 "no-negated-condition"?: #rule
302 "no-nested-ternary"?: #rule
303 "no-new-object"?: #rule
304 "no-plusplus"?: #rule
305 "no-restricted-syntax"?: #rule
306 "no-spaced-func"?: #rule
307 "no-tabs"?: #rule
308 "no-ternary"?: #rule
309 "no-trailing-spaces"?: #rule
310 "no-underscore-dangle"?: #rule
311 "no-unneeded-ternary"?: #rule
312 "no-whitespace-before-property"?: #rule
313 "nonblock-statement-body-position"?: #rule
314 "object-curly-newline"?: #rule
315 "object-curly-spacing"?: #rule
316 "object-property-newline"?: #rule
317 "object-shorthand"?: #rule
318 "one-var"?: #rule
319 "one-var-declaration-per-line"?: #rule
320 "operator-assignment"?: #rule
321 "operator-linebreak"?: #rule
322 "padded-blocks"?: #rule
323 "padding-line-between-statements"?: #rule
324 "quote-props"?: #rule
325 quotes?: #rule
326 "require-jsdoc"?: #rule
327 semi?: #rule
328 "semi-spacing"?: #rule
329 "semi-style"?: #rule
330 "sort-keys"?: #rule
331 "sort-vars"?: #rule
332 "space-before-blocks"?: #rule
333 "space-before-function-paren"?: #rule
334 "spaced-comment"?: #rule
335 "space-infix-ops"?: #rule
336 "space-in-parens"?: #rule
337 "space-unary-ops"?: #rule
338 "switch-colon-spacing"?: #rule
339 "template-tag-spacing"?: #rule
340 "unicode-bom"?: #rule
341 "wrap-regex"?: #rule
342 ...
343 }
344
345 #variables: {
346 "init-declarations"?: #rule
347 "no-catch-shadow"?: #rule
348 "no-delete-var"?: #rule
349 "no-label-var"?: #rule
350 "no-restricted-globals"?: #rule
351 "no-shadow"?: #rule
352 "no-shadow-restricted-names"?: #rule
353 "no-undef"?: #rule
354 "no-undefined"?: #rule
355 "no-undef-init"?: #rule
356 "no-unused-vars"?: #rule
357 "no-use-before-define"?: #rule
358 ...
359 }
360
361 // By default, ESLint supports only ECMAScript 5 syntax. You can override that
362 // setting to enable support for ECMAScript 6 as well as JSX by using
363 // configuration settings.
364 _#defs: "/properties/ecmaFeatures": {
365 arrowFunctions?: bool
366 binaryLiterals?: bool
367 blockBindings?: bool
368 classes?: bool
369 defaultParams?: bool
370 destructuring?: bool
371
372 // Enables support for the experimental object rest/spread properties
373 // (IMPORTANT: This is an experimental feature that may change significantly in
374 // the future. It's recommended that you do not write rules relying on this
375 // functionality unless you are willing to incur maintenance cost when it
376 // changes.)
377 experimentalObjectRestSpread?: bool
378 forOf?: bool
379 generators?: bool
380
381 // allow return statements in the global scope
382 globalReturn?: bool
383
384 // enable global strict mode (if ecmaVersion is 5 or greater)
385 impliedStrict?: bool
386
387 // enable JSX
388 jsx?: bool
389 modules?: bool
390 objectLiteralComputedProperties?: bool
391 objectLiteralDuplicateProperties?: bool
392 objectLiteralShorthandMethods?: bool
393 objectLiteralShorthandProperties?: bool
394 octalLiterals?: bool
395 regexUFlag?: bool
396 regexYFlag?: bool
397 restParams?: bool
398 spread?: bool
399 superInFunctions?: bool
400 templateStrings?: bool
401 unicodeCodePointEscapes?: bool
402 ...
403 }
404
405 // An environment defines global variables that are predefined.
406 _#defs: "/properties/env": {
407 // defines require() and define() as global variables as per the amd spec
408 amd?: bool
409
410 // AppleScript global variables
411 applescript?: bool
412
413 // Atom test helper globals
414 atomtest?: bool
415
416 // browser global variables
417 browser?: bool
418
419 // CommonJS global variables and CommonJS scoping (use this for browser-only
420 // code that uses Browserify/WebPack)
421 commonjs?: bool
422
423 // Globals common to both Node and Browser
424 "shared-node-browser"?: bool
425
426 // Ember test helper globals
427 embertest?: bool
428
429 // enable all ECMAScript 6 features except for modules
430 es6?: bool
431
432 // GreaseMonkey globals
433 greasemonkey?: bool
434
435 // adds all of the Jasmine testing global variables for version 1.3 and 2.0
436 jasmine?: bool
437
438 // Jest global variables
439 jest?: bool
440
441 // jQuery global variables
442 jquery?: bool
443
444 // Meteor global variables
445 meteor?: bool
446
447 // adds all of the Mocha test global variables
448 mocha?: bool
449
450 // MongoDB global variables
451 mongo?: bool
452
453 // Java 8 Nashorn global variables
454 nashorn?: bool
455
456 // Node.js global variables and Node.js scoping
457 node?: bool
458
459 // PhantomJS global variables
460 phantomjs?: bool
461
462 // Prototype.js global variables
463 prototypejs?: bool
464
465 // Protractor global variables
466 protractor?: bool
467
468 // QUnit global variables
469 qunit?: bool
470
471 // Service Worker global variables
472 serviceworker?: bool
473
474 // ShellJS global variables
475 shelljs?: bool
476
477 // WebExtensions globals
478 webextensions?: bool
479
480 // web workers global variables
481 worker?: bool
482 ...
483 }
484
485 // Set each global variable name equal to true to allow the variable to be
486 // overwritten or false to disallow overwriting.
487 _#defs: "/properties/globals": [string]: matchN(1, ["readonly" | "writable" | "off", bool])
488
489 // Allows to override configuration for files and folders, specified by glob patterns
490 _#defs: "/properties/overrides": [...close({
491 // Glob pattern for files to apply 'overrides' configuration, relative to the
492 // directory of the config file
493 files!: matchN(1, [string, list.MinItems(1) & [...string]])
494 extends?: #stringOrStringArray
495 excludedFiles?: #stringOrStringArray
496 ecmaFeatures?: _#defs."/properties/ecmaFeatures"
497 env?: _#defs."/properties/env"
498 globals?: _#defs."/properties/globals"
499 parser?: _#defs."/properties/parser"
500 parserOptions?: _#defs."/properties/parserOptions"
501 plugins?: _#defs."/properties/plugins"
502
503 // To specify a processor, specify the plugin name and processor name joined by a forward slash
504 processor?: string
505 rules?: _#defs."/properties/rules"
506 settings?: _#defs."/properties/settings"
507 overrides?: _#defs."/properties/overrides"
508 })]
509
510 _#defs: "/properties/parser": string
511
512 // The JavaScript language options to be supported
513 _#defs: "/properties/parserOptions": {
514 ecmaFeatures?: _#defs."/properties/ecmaFeatures"
515
516 // Set to 3, 5 (default), 6, 7, 8, 9, 10, 11, 12, 13, 14, or 15 to specify the
517 // version of ECMAScript syntax you want to use. You can also set it to 2015
518 // (same as 6), 2016 (same as 7), 2017 (same as 8), 2018 (same as 9), 2019
519 // (same as 10), 2020 (same as 11), 2021 (same as 12), 2022 (same as 13), 2023
520 // (same as 14), or 2024 (same as 15) to use the year-based naming. You can
521 // also set "latest" to use the most recently supported version.
522 ecmaVersion?: >=3 & <=3 |
523 >=5 & <=5 |
524 >=6 & <=6 |
525 >=2015 & <=2015 |
526 >=7 & <=7 |
527 >=2016 & <=2016 |
528 >=8 & <=8 |
529 >=2017 & <=2017 |
530 >=9 & <=9 |
531 >=2018 & <=2018 |
532 >=10 & <=10 |
533 >=2019 & <=2019 |
534 >=11 & <=11 |
535 >=2020 & <=2020 |
536 >=12 & <=12 |
537 >=2021 & <=2021 |
538 >=13 & <=13 |
539 >=2022 & <=2022 |
540 >=14 & <=14 |
541 >=2023 & <=2023 |
542 >=15 & <=15 |
543 >=2024 & <=2024 |
544 "latest"
545
546 // set to "script" (default), "commonjs", or "module" if your code is in ECMAScript modules
547 sourceType?: "script" | "module" | "commonjs"
548 ...
549 }
550
551 // ESLint supports the use of third-party plugins. Before using the plugin, you
552 // have to install it using npm.
553 _#defs: "/properties/plugins": [...string]
554
555 // ESLint comes with a large number of rules. You can modify which rules your
556 // project uses either using configuration comments or configuration files.
557 _#defs: "/properties/rules": #possibleErrors &
558 #bestPractices &
559 #strictMode &
560 #variables &
561 #nodeAndCommonJs &
562 #stylisticIssues &
563 #ecmaScript6 &
564 #legacy &
565 #Plugins &
566 {...}
567
568 // ESLint supports adding shared settings into configuration file. You can add
569 // settings object to ESLint configuration file and it will be supplied to
570 // every rule that will be executed. This may be useful if you are adding
571 // custom rules and want them to have access to the same information and be
572 // easily configurable.
573 _#defs: "/properties/settings": {...}
574 ...
575}