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