cue.dev/x/npmjs/eslint@v0.6.0

Schema.cue raw

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