@alexlit/lint-kit 126.6.0 → 127.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/eslint.config.js +16 -0
- package/package.json +5 -5
- package/packages/config-eslint/node_modules/ajv/.tonic_example.js +20 -0
- package/packages/config-eslint/node_modules/ajv/LICENSE +22 -0
- package/packages/config-eslint/node_modules/ajv/README.md +1497 -0
- package/packages/config-eslint/node_modules/ajv/dist/ajv.bundle.js +7189 -0
- package/packages/config-eslint/node_modules/ajv/dist/ajv.min.js +3 -0
- package/packages/config-eslint/node_modules/ajv/dist/ajv.min.js.map +1 -0
- package/packages/config-eslint/node_modules/ajv/lib/ajv.d.ts +397 -0
- package/packages/config-eslint/node_modules/ajv/lib/ajv.js +506 -0
- package/packages/config-eslint/node_modules/ajv/lib/cache.js +26 -0
- package/packages/config-eslint/node_modules/ajv/lib/compile/async.js +90 -0
- package/packages/config-eslint/node_modules/ajv/lib/compile/equal.js +5 -0
- package/packages/config-eslint/node_modules/ajv/lib/compile/error_classes.js +34 -0
- package/packages/config-eslint/node_modules/ajv/lib/compile/formats.js +142 -0
- package/packages/config-eslint/node_modules/ajv/lib/compile/index.js +387 -0
- package/packages/config-eslint/node_modules/ajv/lib/compile/resolve.js +270 -0
- package/packages/config-eslint/node_modules/ajv/lib/compile/rules.js +66 -0
- package/packages/config-eslint/node_modules/ajv/lib/compile/schema_obj.js +9 -0
- package/packages/config-eslint/node_modules/ajv/lib/compile/ucs2length.js +20 -0
- package/packages/config-eslint/node_modules/ajv/lib/compile/util.js +239 -0
- package/packages/config-eslint/node_modules/ajv/lib/data.js +49 -0
- package/packages/config-eslint/node_modules/ajv/lib/definition_schema.js +37 -0
- package/packages/config-eslint/node_modules/ajv/lib/dot/_limit.jst +113 -0
- package/packages/config-eslint/node_modules/ajv/lib/dot/_limitItems.jst +12 -0
- package/packages/config-eslint/node_modules/ajv/lib/dot/_limitLength.jst +12 -0
- package/packages/config-eslint/node_modules/ajv/lib/dot/_limitProperties.jst +12 -0
- package/packages/config-eslint/node_modules/ajv/lib/dot/allOf.jst +32 -0
- package/packages/config-eslint/node_modules/ajv/lib/dot/anyOf.jst +46 -0
- package/packages/config-eslint/node_modules/ajv/lib/dot/coerce.def +51 -0
- package/packages/config-eslint/node_modules/ajv/lib/dot/comment.jst +9 -0
- package/packages/config-eslint/node_modules/ajv/lib/dot/const.jst +11 -0
- package/packages/config-eslint/node_modules/ajv/lib/dot/contains.jst +55 -0
- package/packages/config-eslint/node_modules/ajv/lib/dot/custom.jst +191 -0
- package/packages/config-eslint/node_modules/ajv/lib/dot/defaults.def +47 -0
- package/packages/config-eslint/node_modules/ajv/lib/dot/definitions.def +203 -0
- package/packages/config-eslint/node_modules/ajv/lib/dot/dependencies.jst +79 -0
- package/packages/config-eslint/node_modules/ajv/lib/dot/enum.jst +30 -0
- package/packages/config-eslint/node_modules/ajv/lib/dot/errors.def +194 -0
- package/packages/config-eslint/node_modules/ajv/lib/dot/format.jst +106 -0
- package/packages/config-eslint/node_modules/ajv/lib/dot/if.jst +73 -0
- package/packages/config-eslint/node_modules/ajv/lib/dot/items.jst +98 -0
- package/packages/config-eslint/node_modules/ajv/lib/dot/missing.def +39 -0
- package/packages/config-eslint/node_modules/ajv/lib/dot/multipleOf.jst +22 -0
- package/packages/config-eslint/node_modules/ajv/lib/dot/not.jst +43 -0
- package/packages/config-eslint/node_modules/ajv/lib/dot/oneOf.jst +54 -0
- package/packages/config-eslint/node_modules/ajv/lib/dot/pattern.jst +14 -0
- package/packages/config-eslint/node_modules/ajv/lib/dot/properties.jst +245 -0
- package/packages/config-eslint/node_modules/ajv/lib/dot/propertyNames.jst +52 -0
- package/packages/config-eslint/node_modules/ajv/lib/dot/ref.jst +85 -0
- package/packages/config-eslint/node_modules/ajv/lib/dot/required.jst +108 -0
- package/packages/config-eslint/node_modules/ajv/lib/dot/uniqueItems.jst +62 -0
- package/packages/config-eslint/node_modules/ajv/lib/dot/validate.jst +276 -0
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/README.md +3 -0
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/_limit.js +163 -0
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/_limitItems.js +80 -0
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/_limitLength.js +85 -0
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/_limitProperties.js +80 -0
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/allOf.js +42 -0
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/anyOf.js +73 -0
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/comment.js +14 -0
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/const.js +56 -0
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/contains.js +81 -0
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/custom.js +228 -0
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/dependencies.js +168 -0
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/enum.js +66 -0
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/format.js +150 -0
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/if.js +103 -0
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/index.js +33 -0
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/items.js +140 -0
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/multipleOf.js +80 -0
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/not.js +84 -0
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/oneOf.js +73 -0
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/pattern.js +75 -0
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/properties.js +335 -0
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/propertyNames.js +81 -0
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/ref.js +124 -0
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/required.js +270 -0
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/uniqueItems.js +86 -0
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/validate.js +482 -0
- package/packages/config-eslint/node_modules/ajv/lib/keyword.js +146 -0
- package/packages/config-eslint/node_modules/ajv/lib/refs/data.json +17 -0
- package/packages/config-eslint/node_modules/ajv/lib/refs/json-schema-draft-04.json +149 -0
- package/packages/config-eslint/node_modules/ajv/lib/refs/json-schema-draft-06.json +154 -0
- package/packages/config-eslint/node_modules/ajv/lib/refs/json-schema-draft-07.json +168 -0
- package/packages/config-eslint/node_modules/ajv/lib/refs/json-schema-secure.json +94 -0
- package/packages/config-eslint/node_modules/ajv/package.json +106 -0
- package/packages/config-eslint/node_modules/ajv/scripts/.eslintrc.yml +3 -0
- package/packages/config-eslint/node_modules/ajv/scripts/bundle.js +61 -0
- package/packages/config-eslint/node_modules/ajv/scripts/compile-dots.js +73 -0
- package/packages/config-eslint/node_modules/ajv/scripts/info +10 -0
- package/packages/config-eslint/node_modules/ajv/scripts/prepare-tests +12 -0
- package/packages/config-eslint/node_modules/ajv/scripts/publish-built-version +32 -0
- package/packages/config-eslint/node_modules/ajv/scripts/travis-gh-pages +23 -0
- package/packages/config-eslint/node_modules/ansi-styles/index.d.ts +345 -0
- package/packages/config-eslint/node_modules/ansi-styles/index.js +163 -0
- package/packages/config-eslint/node_modules/ansi-styles/license +9 -0
- package/packages/config-eslint/node_modules/ansi-styles/package.json +56 -0
- package/packages/config-eslint/node_modules/ansi-styles/readme.md +152 -0
- package/packages/config-eslint/node_modules/chalk/index.d.ts +415 -0
- package/packages/config-eslint/node_modules/chalk/license +9 -0
- package/packages/config-eslint/node_modules/chalk/package.json +68 -0
- package/packages/config-eslint/node_modules/chalk/readme.md +341 -0
- package/packages/config-eslint/node_modules/chalk/source/index.js +229 -0
- package/packages/config-eslint/node_modules/chalk/source/templates.js +134 -0
- package/packages/config-eslint/node_modules/chalk/source/util.js +39 -0
- package/packages/config-eslint/node_modules/color-convert/CHANGELOG.md +54 -0
- package/packages/config-eslint/node_modules/color-convert/LICENSE +21 -0
- package/packages/config-eslint/node_modules/color-convert/README.md +68 -0
- package/packages/config-eslint/node_modules/color-convert/conversions.js +839 -0
- package/packages/config-eslint/node_modules/color-convert/index.js +81 -0
- package/packages/config-eslint/node_modules/color-convert/package.json +48 -0
- package/packages/config-eslint/node_modules/color-convert/route.js +97 -0
- package/packages/config-eslint/node_modules/color-name/LICENSE +8 -0
- package/packages/config-eslint/node_modules/color-name/README.md +11 -0
- package/packages/config-eslint/node_modules/color-name/index.js +152 -0
- package/packages/config-eslint/node_modules/color-name/package.json +28 -0
- package/packages/config-eslint/node_modules/eslint/LICENSE +19 -0
- package/packages/config-eslint/node_modules/eslint/README.md +306 -0
- package/packages/config-eslint/node_modules/eslint/bin/eslint.js +174 -0
- package/packages/config-eslint/node_modules/eslint/conf/default-cli-options.js +32 -0
- package/packages/config-eslint/node_modules/eslint/conf/ecma-version.js +16 -0
- package/packages/config-eslint/node_modules/eslint/conf/globals.js +160 -0
- package/packages/config-eslint/node_modules/eslint/conf/replacements.json +22 -0
- package/packages/config-eslint/node_modules/eslint/conf/rule-type-list.json +30 -0
- package/packages/config-eslint/node_modules/eslint/lib/api.js +50 -0
- package/packages/config-eslint/node_modules/eslint/lib/cli-engine/cli-engine.js +1089 -0
- package/packages/config-eslint/node_modules/eslint/lib/cli-engine/file-enumerator.js +547 -0
- package/packages/config-eslint/node_modules/eslint/lib/cli-engine/formatters/formatters-meta.json +18 -0
- package/packages/config-eslint/node_modules/eslint/lib/cli-engine/formatters/html.js +351 -0
- package/packages/config-eslint/node_modules/eslint/lib/cli-engine/formatters/json-with-metadata.js +16 -0
- package/packages/config-eslint/node_modules/eslint/lib/cli-engine/formatters/json.js +13 -0
- package/packages/config-eslint/node_modules/eslint/lib/cli-engine/formatters/stylish.js +101 -0
- package/packages/config-eslint/node_modules/eslint/lib/cli-engine/hash.js +35 -0
- package/packages/config-eslint/node_modules/eslint/lib/cli-engine/index.js +7 -0
- package/packages/config-eslint/node_modules/eslint/lib/cli-engine/lint-result-cache.js +203 -0
- package/packages/config-eslint/node_modules/eslint/lib/cli-engine/load-rules.js +46 -0
- package/packages/config-eslint/node_modules/eslint/lib/cli.js +552 -0
- package/packages/config-eslint/node_modules/eslint/lib/config/default-config.js +75 -0
- package/packages/config-eslint/node_modules/eslint/lib/config/flat-config-array.js +423 -0
- package/packages/config-eslint/node_modules/eslint/lib/config/flat-config-helpers.js +132 -0
- package/packages/config-eslint/node_modules/eslint/lib/config/flat-config-schema.js +576 -0
- package/packages/config-eslint/node_modules/eslint/lib/config/rule-validator.js +194 -0
- package/packages/config-eslint/node_modules/eslint/lib/eslint/eslint-helpers.js +975 -0
- package/packages/config-eslint/node_modules/eslint/lib/eslint/eslint.js +1307 -0
- package/packages/config-eslint/node_modules/eslint/lib/eslint/index.js +9 -0
- package/packages/config-eslint/node_modules/eslint/lib/eslint/legacy-eslint.js +742 -0
- package/packages/config-eslint/node_modules/eslint/lib/languages/js/index.js +252 -0
- package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/index.js +7 -0
- package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/source-code.js +1318 -0
- package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/backward-token-comment-cursor.js +57 -0
- package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/backward-token-cursor.js +58 -0
- package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/cursor.js +76 -0
- package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/cursors.js +92 -0
- package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/decorative-cursor.js +39 -0
- package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/filter-cursor.js +43 -0
- package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/forward-token-comment-cursor.js +57 -0
- package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/forward-token-cursor.js +63 -0
- package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/index.js +627 -0
- package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/limit-cursor.js +40 -0
- package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/padded-token-cursor.js +38 -0
- package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/skip-cursor.js +42 -0
- package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/utils.js +107 -0
- package/packages/config-eslint/node_modules/eslint/lib/languages/js/validate-language-options.js +181 -0
- package/packages/config-eslint/node_modules/eslint/lib/linter/apply-disable-directives.js +513 -0
- package/packages/config-eslint/node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js +851 -0
- package/packages/config-eslint/node_modules/eslint/lib/linter/code-path-analysis/code-path-segment.js +263 -0
- package/packages/config-eslint/node_modules/eslint/lib/linter/code-path-analysis/code-path-state.js +2348 -0
- package/packages/config-eslint/node_modules/eslint/lib/linter/code-path-analysis/code-path.js +344 -0
- package/packages/config-eslint/node_modules/eslint/lib/linter/code-path-analysis/debug-helpers.js +203 -0
- package/packages/config-eslint/node_modules/eslint/lib/linter/code-path-analysis/fork-context.js +349 -0
- package/packages/config-eslint/node_modules/eslint/lib/linter/code-path-analysis/id-generator.js +45 -0
- package/packages/config-eslint/node_modules/eslint/lib/linter/config-comment-parser.js +169 -0
- package/packages/config-eslint/node_modules/eslint/lib/linter/index.js +11 -0
- package/packages/config-eslint/node_modules/eslint/lib/linter/interpolate.js +50 -0
- package/packages/config-eslint/node_modules/eslint/lib/linter/linter.js +2410 -0
- package/packages/config-eslint/node_modules/eslint/lib/linter/node-event-generator.js +352 -0
- package/packages/config-eslint/node_modules/eslint/lib/linter/report-translator.js +376 -0
- package/packages/config-eslint/node_modules/eslint/lib/linter/rule-fixer.js +163 -0
- package/packages/config-eslint/node_modules/eslint/lib/linter/rules.js +71 -0
- package/packages/config-eslint/node_modules/eslint/lib/linter/safe-emitter.js +52 -0
- package/packages/config-eslint/node_modules/eslint/lib/linter/source-code-fixer.js +152 -0
- package/packages/config-eslint/node_modules/eslint/lib/linter/timing.js +169 -0
- package/packages/config-eslint/node_modules/eslint/lib/linter/vfile.js +111 -0
- package/packages/config-eslint/node_modules/eslint/lib/options.js +442 -0
- package/packages/config-eslint/node_modules/eslint/lib/rule-tester/index.js +7 -0
- package/packages/config-eslint/node_modules/eslint/lib/rule-tester/rule-tester.js +1286 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/accessor-pairs.js +346 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/array-bracket-newline.js +261 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/array-bracket-spacing.js +244 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/array-callback-return.js +446 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/array-element-newline.js +311 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/arrow-body-style.js +296 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/arrow-parens.js +186 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/arrow-spacing.js +164 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/block-scoped-var.js +135 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/block-spacing.js +174 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/brace-style.js +197 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/callback-return.js +187 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/camelcase.js +397 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/capitalized-comments.js +303 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/class-methods-use-this.js +187 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/comma-dangle.js +373 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/comma-spacing.js +192 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/comma-style.js +314 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/complexity.js +178 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/computed-property-spacing.js +208 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/consistent-return.js +210 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/consistent-this.js +153 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/constructor-super.js +445 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/curly.js +486 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/default-case-last.js +44 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/default-case.js +97 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/default-param-last.js +62 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/dot-location.js +108 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/dot-notation.js +176 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/eol-last.js +115 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/eqeqeq.js +174 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/for-direction.js +140 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/func-call-spacing.js +233 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/func-name-matching.js +253 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/func-names.js +191 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/func-style.js +136 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/function-call-argument-newline.js +125 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/function-paren-newline.js +292 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/generator-star-spacing.js +209 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/getter-return.js +204 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/global-require.js +90 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/grouped-accessor-pairs.js +215 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/guard-for-in.js +76 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/handle-callback-err.js +101 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/id-blacklist.js +246 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/id-denylist.js +228 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/id-length.js +177 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/id-match.js +299 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/implicit-arrow-linebreak.js +84 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/indent-legacy.js +1126 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/indent.js +1803 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/index.js +305 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/init-declarations.js +139 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/jsx-quotes.js +98 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/key-spacing.js +687 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/keyword-spacing.js +640 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/line-comment-position.js +125 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/linebreak-style.js +108 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/lines-around-comment.js +471 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/lines-around-directive.js +201 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/lines-between-class-members.js +269 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/logical-assignment-operators.js +504 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/max-classes-per-file.js +89 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/max-depth.js +156 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/max-len.js +440 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/max-lines-per-function.js +213 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/max-lines.js +193 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/max-nested-callbacks.js +117 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/max-params.js +102 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/max-statements-per-line.js +199 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/max-statements.js +184 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/multiline-comment-style.js +476 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/multiline-ternary.js +174 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/new-cap.js +276 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/new-parens.js +93 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/newline-after-var.js +253 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/newline-before-return.js +217 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/newline-per-chained-call.js +126 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-alert.js +138 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-array-constructor.js +133 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-async-promise-executor.js +39 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-await-in-loop.js +106 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-bitwise.js +119 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-buffer-constructor.js +50 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-caller.js +46 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-case-declarations.js +76 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-catch-shadow.js +82 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-class-assign.js +63 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-compare-neg-zero.js +60 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-cond-assign.js +159 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-confusing-arrow.js +92 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-console.js +207 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-const-assign.js +56 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-constant-binary-expression.js +508 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-constant-condition.js +161 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-constructor-return.js +62 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-continue.js +39 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-control-regex.js +138 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-debugger.js +43 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-delete-var.js +42 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-div-regex.js +53 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-dupe-args.js +82 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-dupe-class-members.js +104 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-dupe-else-if.js +122 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-dupe-keys.js +142 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-duplicate-case.js +71 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-duplicate-imports.js +290 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-else-return.js +405 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-empty-character-class.js +76 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-empty-function.js +167 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-empty-pattern.js +78 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-empty-static-block.js +47 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-empty.js +103 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-eq-null.js +46 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-eval.js +286 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-ex-assign.js +54 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-extend-native.js +178 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-extra-bind.js +213 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-extra-boolean-cast.js +369 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-extra-label.js +149 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-extra-parens.js +1322 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-extra-semi.js +147 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-fallthrough.js +221 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-floating-decimal.js +73 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-func-assign.js +78 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-global-assign.js +95 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-implicit-coercion.js +422 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-implicit-globals.js +146 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-implied-eval.js +132 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-import-assign.js +241 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-inline-comments.js +110 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-inner-declarations.js +131 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-invalid-regexp.js +194 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-invalid-this.js +150 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-irregular-whitespace.js +276 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-iterator.js +52 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-label-var.js +80 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-labels.js +149 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-lone-blocks.js +136 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-lonely-if.js +88 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-loop-func.js +238 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-loss-of-precision.js +214 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-magic-numbers.js +243 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-misleading-character-class.js +537 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-mixed-operators.js +229 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-mixed-requires.js +238 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-mixed-spaces-and-tabs.js +116 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-multi-assign.js +67 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-multi-spaces.js +141 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-multi-str.js +65 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-multiple-empty-lines.js +154 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-native-reassign.js +98 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-negated-condition.js +95 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-negated-in-lhs.js +46 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-nested-ternary.js +44 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-new-func.js +87 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-new-native-nonconstructor.js +66 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-new-object.js +67 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-new-require.js +50 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-new-symbol.js +63 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-new-wrappers.js +60 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-new.js +43 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-nonoctal-decimal-escape.js +148 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-obj-calls.js +86 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-object-constructor.js +117 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-octal-escape.js +56 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-octal.js +45 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-param-reassign.js +230 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-path-concat.js +64 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-plusplus.js +105 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-process-env.js +51 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-process-exit.js +47 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-promise-executor-return.js +263 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-proto.js +48 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-prototype-builtins.js +159 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-redeclare.js +174 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-regex-spaces.js +197 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-restricted-exports.js +204 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-restricted-globals.js +124 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-restricted-imports.js +563 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-restricted-modules.js +213 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-restricted-properties.js +168 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-restricted-syntax.js +70 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-return-assign.js +80 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-return-await.js +135 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-script-url.js +61 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-self-assign.js +183 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-self-compare.js +60 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-sequences.js +139 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-setter-return.js +226 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-shadow-restricted-names.js +65 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-shadow.js +336 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-spaced-func.js +83 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-sparse-arrays.js +73 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-sync.js +64 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-tabs.js +81 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-template-curly-in-string.js +44 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-ternary.js +41 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-this-before-super.js +363 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-throw-literal.js +51 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-trailing-spaces.js +192 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-undef-init.js +75 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-undef.js +79 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-undefined.js +86 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-underscore-dangle.js +335 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-unexpected-multiline.js +120 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-unmodified-loop-condition.js +360 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-unneeded-ternary.js +166 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-unreachable-loop.js +185 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-unreachable.js +293 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-unsafe-finally.js +111 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-unsafe-negation.js +128 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-unsafe-optional-chaining.js +205 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-unused-expressions.js +186 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-unused-labels.js +143 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-unused-private-class-members.js +195 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-unused-vars.js +881 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-use-before-define.js +348 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-useless-assignment.js +566 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-useless-backreference.js +244 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-useless-call.js +90 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-useless-catch.js +57 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-useless-computed-key.js +168 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-useless-concat.js +115 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-useless-constructor.js +189 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-useless-escape.js +333 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-useless-rename.js +172 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-useless-return.js +369 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-var.js +334 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-void.js +64 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-warning-comments.js +201 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-whitespace-before-property.js +116 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/no-with.js +39 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/nonblock-statement-body-position.js +127 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/object-curly-newline.js +324 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/object-curly-spacing.js +311 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/object-property-newline.js +102 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/object-shorthand.js +521 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/one-var-declaration-per-line.js +95 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/one-var.js +567 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/operator-assignment.js +209 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/operator-linebreak.js +253 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/padded-blocks.js +310 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/padding-line-between-statements.js +590 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-arrow-callback.js +381 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-const.js +501 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-destructuring.js +301 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-exponentiation-operator.js +191 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-named-capture-group.js +178 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-numeric-literals.js +148 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-object-has-own.js +114 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-object-spread.js +298 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-promise-reject-errors.js +132 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-reflect.js +127 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-regex-literals.js +507 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-rest-params.js +118 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-spread.js +87 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-template.js +275 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/quote-props.js +310 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/quotes.js +350 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/radix.js +198 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/require-atomic-updates.js +331 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/require-await.js +147 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/require-unicode-regexp.js +129 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/require-yield.js +77 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/rest-spread-spacing.js +123 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/semi-spacing.js +248 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/semi-style.js +158 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/semi.js +438 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/sort-imports.js +241 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/sort-keys.js +230 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/sort-vars.js +104 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/space-before-blocks.js +204 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/space-before-function-paren.js +167 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/space-in-parens.js +285 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/space-infix-ops.js +198 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/space-unary-ops.js +324 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/spaced-comment.js +385 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/strict.js +277 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/switch-colon-spacing.js +132 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/symbol-description.js +73 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/template-curly-spacing.js +144 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/template-tag-spacing.js +93 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/unicode-bom.js +73 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/use-isnan.js +235 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/utils/ast-utils.js +2292 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/utils/char-source.js +240 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/utils/fix-tracker.js +114 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/utils/keywords.js +67 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/utils/lazy-loading-rule-map.js +115 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/utils/regular-expressions.js +42 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/utils/unicode/index.js +16 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/utils/unicode/is-combining-character.js +13 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/utils/unicode/is-emoji-modifier.js +13 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/utils/unicode/is-regional-indicator-symbol.js +13 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/utils/unicode/is-surrogate-pair.js +14 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/valid-typeof.js +127 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/vars-on-top.js +157 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/wrap-iife.js +207 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/wrap-regex.js +61 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/yield-star-spacing.js +130 -0
- package/packages/config-eslint/node_modules/eslint/lib/rules/yoda.js +353 -0
- package/packages/config-eslint/node_modules/eslint/lib/shared/ajv.js +34 -0
- package/packages/config-eslint/node_modules/eslint/lib/shared/ast-utils.js +29 -0
- package/packages/config-eslint/node_modules/eslint/lib/shared/directives.js +15 -0
- package/packages/config-eslint/node_modules/eslint/lib/shared/flags.js +27 -0
- package/packages/config-eslint/node_modules/eslint/lib/shared/logging.js +39 -0
- package/packages/config-eslint/node_modules/eslint/lib/shared/runtime-info.js +168 -0
- package/packages/config-eslint/node_modules/eslint/lib/shared/serialization.js +55 -0
- package/packages/config-eslint/node_modules/eslint/lib/shared/severity.js +49 -0
- package/packages/config-eslint/node_modules/eslint/lib/shared/stats.js +30 -0
- package/packages/config-eslint/node_modules/eslint/lib/shared/string-utils.js +58 -0
- package/packages/config-eslint/node_modules/eslint/lib/shared/traverser.js +195 -0
- package/packages/config-eslint/node_modules/eslint/lib/shared/types.js +250 -0
- package/packages/config-eslint/node_modules/eslint/lib/unsupported-api.js +28 -0
- package/packages/config-eslint/node_modules/eslint/messages/all-files-ignored.js +16 -0
- package/packages/config-eslint/node_modules/eslint/messages/all-matched-files-ignored.js +21 -0
- package/packages/config-eslint/node_modules/eslint/messages/config-file-missing.js +16 -0
- package/packages/config-eslint/node_modules/eslint/messages/eslintrc-incompat.js +119 -0
- package/packages/config-eslint/node_modules/eslint/messages/eslintrc-plugins.js +24 -0
- package/packages/config-eslint/node_modules/eslint/messages/extend-config-missing.js +13 -0
- package/packages/config-eslint/node_modules/eslint/messages/failed-to-read-json.js +11 -0
- package/packages/config-eslint/node_modules/eslint/messages/file-not-found.js +10 -0
- package/packages/config-eslint/node_modules/eslint/messages/invalid-rule-options.js +17 -0
- package/packages/config-eslint/node_modules/eslint/messages/invalid-rule-severity.js +13 -0
- package/packages/config-eslint/node_modules/eslint/messages/no-config-found.js +15 -0
- package/packages/config-eslint/node_modules/eslint/messages/plugin-conflict.js +22 -0
- package/packages/config-eslint/node_modules/eslint/messages/plugin-invalid.js +16 -0
- package/packages/config-eslint/node_modules/eslint/messages/plugin-missing.js +19 -0
- package/packages/config-eslint/node_modules/eslint/messages/print-config-with-directory-path.js +8 -0
- package/packages/config-eslint/node_modules/eslint/messages/shared.js +18 -0
- package/packages/config-eslint/node_modules/eslint/messages/whitespace-found.js +11 -0
- package/packages/config-eslint/node_modules/eslint/package.json +188 -0
- package/packages/config-eslint/node_modules/eslint-scope/LICENSE +22 -0
- package/packages/config-eslint/node_modules/eslint-scope/README.md +91 -0
- package/packages/config-eslint/node_modules/eslint-scope/dist/eslint-scope.cjs +2266 -0
- package/packages/config-eslint/node_modules/eslint-scope/lib/definition.js +85 -0
- package/packages/config-eslint/node_modules/eslint-scope/lib/index.js +169 -0
- package/packages/config-eslint/node_modules/eslint-scope/lib/pattern-visitor.js +154 -0
- package/packages/config-eslint/node_modules/eslint-scope/lib/reference.js +166 -0
- package/packages/config-eslint/node_modules/eslint-scope/lib/referencer.js +656 -0
- package/packages/config-eslint/node_modules/eslint-scope/lib/scope-manager.js +249 -0
- package/packages/config-eslint/node_modules/eslint-scope/lib/scope.js +793 -0
- package/packages/config-eslint/node_modules/eslint-scope/lib/variable.js +87 -0
- package/packages/config-eslint/node_modules/eslint-scope/lib/version.js +3 -0
- package/packages/config-eslint/node_modules/eslint-scope/package.json +65 -0
- package/packages/config-eslint/node_modules/file-entry-cache/LICENSE +22 -0
- package/packages/config-eslint/node_modules/file-entry-cache/README.md +115 -0
- package/packages/config-eslint/node_modules/file-entry-cache/cache.js +291 -0
- package/packages/config-eslint/node_modules/file-entry-cache/package.json +56 -0
- package/packages/config-eslint/node_modules/find-up/index.d.ts +138 -0
- package/packages/config-eslint/node_modules/find-up/index.js +89 -0
- package/packages/config-eslint/node_modules/find-up/license +9 -0
- package/packages/config-eslint/node_modules/find-up/package.json +54 -0
- package/packages/config-eslint/node_modules/find-up/readme.md +151 -0
- package/packages/config-eslint/node_modules/flat-cache/LICENSE +22 -0
- package/packages/config-eslint/node_modules/flat-cache/README.md +77 -0
- package/packages/config-eslint/node_modules/flat-cache/changelog.md +278 -0
- package/packages/config-eslint/node_modules/flat-cache/package.json +63 -0
- package/packages/config-eslint/node_modules/flat-cache/src/cache.js +214 -0
- package/packages/config-eslint/node_modules/flat-cache/src/del.js +30 -0
- package/packages/config-eslint/node_modules/flat-cache/src/utils.js +42 -0
- package/packages/config-eslint/node_modules/glob-parent/LICENSE +15 -0
- package/packages/config-eslint/node_modules/glob-parent/README.md +134 -0
- package/packages/config-eslint/node_modules/glob-parent/index.js +75 -0
- package/packages/config-eslint/node_modules/glob-parent/package.json +54 -0
- package/packages/config-eslint/node_modules/json-schema-traverse/.eslintrc.yml +27 -0
- package/packages/config-eslint/node_modules/json-schema-traverse/.travis.yml +8 -0
- package/packages/config-eslint/node_modules/json-schema-traverse/LICENSE +21 -0
- package/packages/config-eslint/node_modules/json-schema-traverse/README.md +83 -0
- package/packages/config-eslint/node_modules/json-schema-traverse/index.js +89 -0
- package/packages/config-eslint/node_modules/json-schema-traverse/package.json +43 -0
- package/packages/config-eslint/node_modules/json-schema-traverse/spec/.eslintrc.yml +6 -0
- package/packages/config-eslint/node_modules/json-schema-traverse/spec/fixtures/schema.js +125 -0
- package/packages/config-eslint/node_modules/json-schema-traverse/spec/index.spec.js +171 -0
- package/packages/config-eslint/node_modules/locate-path/index.d.ts +83 -0
- package/packages/config-eslint/node_modules/locate-path/index.js +68 -0
- package/packages/config-eslint/node_modules/locate-path/license +9 -0
- package/packages/config-eslint/node_modules/locate-path/package.json +46 -0
- package/packages/config-eslint/node_modules/locate-path/readme.md +125 -0
- package/packages/config-eslint/node_modules/p-limit/index.d.ts +42 -0
- package/packages/config-eslint/node_modules/p-limit/index.js +71 -0
- package/packages/config-eslint/node_modules/p-limit/license +9 -0
- package/packages/config-eslint/node_modules/p-limit/package.json +52 -0
- package/packages/config-eslint/node_modules/p-limit/readme.md +101 -0
- package/packages/config-eslint/node_modules/p-locate/index.d.ts +53 -0
- package/packages/config-eslint/node_modules/p-locate/index.js +50 -0
- package/packages/config-eslint/node_modules/p-locate/license +9 -0
- package/packages/config-eslint/node_modules/p-locate/package.json +54 -0
- package/packages/config-eslint/node_modules/p-locate/readme.md +93 -0
- package/packages/config-eslint/node_modules/path-exists/index.d.ts +28 -0
- package/packages/config-eslint/node_modules/path-exists/index.js +23 -0
- package/packages/config-eslint/node_modules/path-exists/license +9 -0
- package/packages/config-eslint/node_modules/path-exists/package.json +39 -0
- package/packages/config-eslint/node_modules/path-exists/readme.md +52 -0
- package/packages/config-eslint/node_modules/yocto-queue/index.d.ts +56 -0
- package/packages/config-eslint/node_modules/yocto-queue/index.js +68 -0
- package/packages/config-eslint/node_modules/yocto-queue/license +9 -0
- package/packages/config-eslint/node_modules/yocto-queue/package.json +43 -0
- package/packages/config-eslint/node_modules/yocto-queue/readme.md +64 -0
- package/packages/config-eslint/package.json +3 -3
- package/packages/config-hooks/package.json +2 -2
- package/packages/config-stylelint/package.json +2 -2
|
@@ -0,0 +1,552 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Main CLI object.
|
|
3
|
+
* @author Nicholas C. Zakas
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
"use strict";
|
|
7
|
+
|
|
8
|
+
/*
|
|
9
|
+
* NOTE: The CLI object should *not* call process.exit() directly. It should only return
|
|
10
|
+
* exit codes. This allows other programs to use the CLI object and still control
|
|
11
|
+
* when the program exits.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
//------------------------------------------------------------------------------
|
|
15
|
+
// Requirements
|
|
16
|
+
//------------------------------------------------------------------------------
|
|
17
|
+
|
|
18
|
+
const fs = require("node:fs"),
|
|
19
|
+
path = require("node:path"),
|
|
20
|
+
{ promisify } = require("node:util"),
|
|
21
|
+
{ LegacyESLint } = require("./eslint"),
|
|
22
|
+
{ ESLint, shouldUseFlatConfig, locateConfigFileToUse } = require("./eslint/eslint"),
|
|
23
|
+
createCLIOptions = require("./options"),
|
|
24
|
+
log = require("./shared/logging"),
|
|
25
|
+
RuntimeInfo = require("./shared/runtime-info"),
|
|
26
|
+
{ normalizeSeverityToString } = require("./shared/severity");
|
|
27
|
+
const { Legacy: { naming } } = require("@eslint/eslintrc");
|
|
28
|
+
const { ModuleImporter } = require("@humanwhocodes/module-importer");
|
|
29
|
+
const debug = require("debug")("eslint:cli");
|
|
30
|
+
|
|
31
|
+
//------------------------------------------------------------------------------
|
|
32
|
+
// Types
|
|
33
|
+
//------------------------------------------------------------------------------
|
|
34
|
+
|
|
35
|
+
/** @typedef {import("./eslint/eslint").ESLintOptions} ESLintOptions */
|
|
36
|
+
/** @typedef {import("./eslint/eslint").LintMessage} LintMessage */
|
|
37
|
+
/** @typedef {import("./eslint/eslint").LintResult} LintResult */
|
|
38
|
+
/** @typedef {import("./options").ParsedCLIOptions} ParsedCLIOptions */
|
|
39
|
+
/** @typedef {import("./shared/types").Plugin} Plugin */
|
|
40
|
+
/** @typedef {import("./shared/types").ResultsMeta} ResultsMeta */
|
|
41
|
+
|
|
42
|
+
//------------------------------------------------------------------------------
|
|
43
|
+
// Helpers
|
|
44
|
+
//------------------------------------------------------------------------------
|
|
45
|
+
|
|
46
|
+
const mkdir = promisify(fs.mkdir);
|
|
47
|
+
const stat = promisify(fs.stat);
|
|
48
|
+
const writeFile = promisify(fs.writeFile);
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Loads plugins with the specified names.
|
|
52
|
+
* @param {{ "import": (name: string) => Promise<any> }} importer An object with an `import` method called once for each plugin.
|
|
53
|
+
* @param {string[]} pluginNames The names of the plugins to be loaded, with or without the "eslint-plugin-" prefix.
|
|
54
|
+
* @returns {Promise<Record<string, Plugin>>} A mapping of plugin short names to implementations.
|
|
55
|
+
*/
|
|
56
|
+
async function loadPlugins(importer, pluginNames) {
|
|
57
|
+
const plugins = {};
|
|
58
|
+
|
|
59
|
+
await Promise.all(pluginNames.map(async pluginName => {
|
|
60
|
+
|
|
61
|
+
const longName = naming.normalizePackageName(pluginName, "eslint-plugin");
|
|
62
|
+
const module = await importer.import(longName);
|
|
63
|
+
|
|
64
|
+
if (!("default" in module)) {
|
|
65
|
+
throw new Error(`"${longName}" cannot be used with the \`--plugin\` option because its default module does not provide a \`default\` export`);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const shortName = naming.getShorthandName(pluginName, "eslint-plugin");
|
|
69
|
+
|
|
70
|
+
plugins[shortName] = module.default;
|
|
71
|
+
}));
|
|
72
|
+
|
|
73
|
+
return plugins;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Predicate function for whether or not to apply fixes in quiet mode.
|
|
78
|
+
* If a message is a warning, do not apply a fix.
|
|
79
|
+
* @param {LintMessage} message The lint result.
|
|
80
|
+
* @returns {boolean} True if the lint message is an error (and thus should be
|
|
81
|
+
* autofixed), false otherwise.
|
|
82
|
+
*/
|
|
83
|
+
function quietFixPredicate(message) {
|
|
84
|
+
return message.severity === 2;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Predicate function for whether or not to run a rule in quiet mode.
|
|
89
|
+
* If a rule is set to warning, do not run it.
|
|
90
|
+
* @param {{ ruleId: string; severity: number; }} rule The rule id and severity.
|
|
91
|
+
* @returns {boolean} True if the lint rule should run, false otherwise.
|
|
92
|
+
*/
|
|
93
|
+
function quietRuleFilter(rule) {
|
|
94
|
+
return rule.severity === 2;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Translates the CLI options into the options expected by the ESLint constructor.
|
|
99
|
+
* @param {ParsedCLIOptions} cliOptions The CLI options to translate.
|
|
100
|
+
* @param {"flat"|"eslintrc"} [configType="eslintrc"] The format of the
|
|
101
|
+
* config to generate.
|
|
102
|
+
* @returns {Promise<ESLintOptions>} The options object for the ESLint constructor.
|
|
103
|
+
* @private
|
|
104
|
+
*/
|
|
105
|
+
async function translateOptions({
|
|
106
|
+
cache,
|
|
107
|
+
cacheFile,
|
|
108
|
+
cacheLocation,
|
|
109
|
+
cacheStrategy,
|
|
110
|
+
config,
|
|
111
|
+
configLookup,
|
|
112
|
+
env,
|
|
113
|
+
errorOnUnmatchedPattern,
|
|
114
|
+
eslintrc,
|
|
115
|
+
ext,
|
|
116
|
+
fix,
|
|
117
|
+
fixDryRun,
|
|
118
|
+
fixType,
|
|
119
|
+
flag,
|
|
120
|
+
global,
|
|
121
|
+
ignore,
|
|
122
|
+
ignorePath,
|
|
123
|
+
ignorePattern,
|
|
124
|
+
inlineConfig,
|
|
125
|
+
parser,
|
|
126
|
+
parserOptions,
|
|
127
|
+
plugin,
|
|
128
|
+
quiet,
|
|
129
|
+
reportUnusedDisableDirectives,
|
|
130
|
+
reportUnusedDisableDirectivesSeverity,
|
|
131
|
+
resolvePluginsRelativeTo,
|
|
132
|
+
rule,
|
|
133
|
+
rulesdir,
|
|
134
|
+
stats,
|
|
135
|
+
warnIgnored,
|
|
136
|
+
passOnNoPatterns,
|
|
137
|
+
maxWarnings
|
|
138
|
+
}, configType) {
|
|
139
|
+
|
|
140
|
+
let overrideConfig, overrideConfigFile;
|
|
141
|
+
const importer = new ModuleImporter();
|
|
142
|
+
|
|
143
|
+
if (configType === "flat") {
|
|
144
|
+
overrideConfigFile = (typeof config === "string") ? config : !configLookup;
|
|
145
|
+
if (overrideConfigFile === false) {
|
|
146
|
+
overrideConfigFile = void 0;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
let globals = {};
|
|
150
|
+
|
|
151
|
+
if (global) {
|
|
152
|
+
globals = global.reduce((obj, name) => {
|
|
153
|
+
if (name.endsWith(":true")) {
|
|
154
|
+
obj[name.slice(0, -5)] = "writable";
|
|
155
|
+
} else {
|
|
156
|
+
obj[name] = "readonly";
|
|
157
|
+
}
|
|
158
|
+
return obj;
|
|
159
|
+
}, globals);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
overrideConfig = [{
|
|
163
|
+
languageOptions: {
|
|
164
|
+
globals,
|
|
165
|
+
parserOptions: parserOptions || {}
|
|
166
|
+
},
|
|
167
|
+
rules: rule ? rule : {}
|
|
168
|
+
}];
|
|
169
|
+
|
|
170
|
+
if (reportUnusedDisableDirectives || reportUnusedDisableDirectivesSeverity !== void 0) {
|
|
171
|
+
overrideConfig[0].linterOptions = {
|
|
172
|
+
reportUnusedDisableDirectives: reportUnusedDisableDirectives
|
|
173
|
+
? "error"
|
|
174
|
+
: normalizeSeverityToString(reportUnusedDisableDirectivesSeverity)
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
if (parser) {
|
|
179
|
+
overrideConfig[0].languageOptions.parser = await importer.import(parser);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
if (plugin) {
|
|
183
|
+
overrideConfig[0].plugins = await loadPlugins(importer, plugin);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
} else {
|
|
187
|
+
overrideConfigFile = config;
|
|
188
|
+
|
|
189
|
+
overrideConfig = {
|
|
190
|
+
env: env && env.reduce((obj, name) => {
|
|
191
|
+
obj[name] = true;
|
|
192
|
+
return obj;
|
|
193
|
+
}, {}),
|
|
194
|
+
globals: global && global.reduce((obj, name) => {
|
|
195
|
+
if (name.endsWith(":true")) {
|
|
196
|
+
obj[name.slice(0, -5)] = "writable";
|
|
197
|
+
} else {
|
|
198
|
+
obj[name] = "readonly";
|
|
199
|
+
}
|
|
200
|
+
return obj;
|
|
201
|
+
}, {}),
|
|
202
|
+
ignorePatterns: ignorePattern,
|
|
203
|
+
parser,
|
|
204
|
+
parserOptions,
|
|
205
|
+
plugins: plugin,
|
|
206
|
+
rules: rule
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
const options = {
|
|
211
|
+
allowInlineConfig: inlineConfig,
|
|
212
|
+
cache,
|
|
213
|
+
cacheLocation: cacheLocation || cacheFile,
|
|
214
|
+
cacheStrategy,
|
|
215
|
+
errorOnUnmatchedPattern,
|
|
216
|
+
fix: (fix || fixDryRun) && (quiet ? quietFixPredicate : true),
|
|
217
|
+
fixTypes: fixType,
|
|
218
|
+
ignore,
|
|
219
|
+
overrideConfig,
|
|
220
|
+
overrideConfigFile,
|
|
221
|
+
passOnNoPatterns
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
if (configType === "flat") {
|
|
225
|
+
options.ignorePatterns = ignorePattern;
|
|
226
|
+
options.stats = stats;
|
|
227
|
+
options.warnIgnored = warnIgnored;
|
|
228
|
+
options.flags = flag;
|
|
229
|
+
|
|
230
|
+
/*
|
|
231
|
+
* For performance reasons rules not marked as 'error' are filtered out in quiet mode. As maxWarnings
|
|
232
|
+
* requires rules set to 'warn' to be run, we only filter out 'warn' rules if maxWarnings is not specified.
|
|
233
|
+
*/
|
|
234
|
+
options.ruleFilter = quiet && maxWarnings === -1 ? quietRuleFilter : () => true;
|
|
235
|
+
} else {
|
|
236
|
+
options.resolvePluginsRelativeTo = resolvePluginsRelativeTo;
|
|
237
|
+
options.rulePaths = rulesdir;
|
|
238
|
+
options.useEslintrc = eslintrc;
|
|
239
|
+
options.extensions = ext;
|
|
240
|
+
options.ignorePath = ignorePath;
|
|
241
|
+
if (reportUnusedDisableDirectives || reportUnusedDisableDirectivesSeverity !== void 0) {
|
|
242
|
+
options.reportUnusedDisableDirectives = reportUnusedDisableDirectives
|
|
243
|
+
? "error"
|
|
244
|
+
: normalizeSeverityToString(reportUnusedDisableDirectivesSeverity);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
return options;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Count error messages.
|
|
253
|
+
* @param {LintResult[]} results The lint results.
|
|
254
|
+
* @returns {{errorCount:number;fatalErrorCount:number,warningCount:number}} The number of error messages.
|
|
255
|
+
*/
|
|
256
|
+
function countErrors(results) {
|
|
257
|
+
let errorCount = 0;
|
|
258
|
+
let fatalErrorCount = 0;
|
|
259
|
+
let warningCount = 0;
|
|
260
|
+
|
|
261
|
+
for (const result of results) {
|
|
262
|
+
errorCount += result.errorCount;
|
|
263
|
+
fatalErrorCount += result.fatalErrorCount;
|
|
264
|
+
warningCount += result.warningCount;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
return { errorCount, fatalErrorCount, warningCount };
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* Check if a given file path is a directory or not.
|
|
272
|
+
* @param {string} filePath The path to a file to check.
|
|
273
|
+
* @returns {Promise<boolean>} `true` if the given path is a directory.
|
|
274
|
+
*/
|
|
275
|
+
async function isDirectory(filePath) {
|
|
276
|
+
try {
|
|
277
|
+
return (await stat(filePath)).isDirectory();
|
|
278
|
+
} catch (error) {
|
|
279
|
+
if (error.code === "ENOENT" || error.code === "ENOTDIR") {
|
|
280
|
+
return false;
|
|
281
|
+
}
|
|
282
|
+
throw error;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* Outputs the results of the linting.
|
|
288
|
+
* @param {ESLint} engine The ESLint instance to use.
|
|
289
|
+
* @param {LintResult[]} results The results to print.
|
|
290
|
+
* @param {string} format The name of the formatter to use or the path to the formatter.
|
|
291
|
+
* @param {string} outputFile The path for the output file.
|
|
292
|
+
* @param {ResultsMeta} resultsMeta Warning count and max threshold.
|
|
293
|
+
* @returns {Promise<boolean>} True if the printing succeeds, false if not.
|
|
294
|
+
* @private
|
|
295
|
+
*/
|
|
296
|
+
async function printResults(engine, results, format, outputFile, resultsMeta) {
|
|
297
|
+
let formatter;
|
|
298
|
+
|
|
299
|
+
try {
|
|
300
|
+
formatter = await engine.loadFormatter(format);
|
|
301
|
+
} catch (e) {
|
|
302
|
+
log.error(e.message);
|
|
303
|
+
return false;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
const output = await formatter.format(results, resultsMeta);
|
|
307
|
+
|
|
308
|
+
if (outputFile) {
|
|
309
|
+
const filePath = path.resolve(process.cwd(), outputFile);
|
|
310
|
+
|
|
311
|
+
if (await isDirectory(filePath)) {
|
|
312
|
+
log.error("Cannot write to output file path, it is a directory: %s", outputFile);
|
|
313
|
+
return false;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
try {
|
|
317
|
+
await mkdir(path.dirname(filePath), { recursive: true });
|
|
318
|
+
await writeFile(filePath, output);
|
|
319
|
+
} catch (ex) {
|
|
320
|
+
log.error("There was a problem writing the output file:\n%s", ex);
|
|
321
|
+
return false;
|
|
322
|
+
}
|
|
323
|
+
} else if (output) {
|
|
324
|
+
log.info(output);
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
return true;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
//------------------------------------------------------------------------------
|
|
331
|
+
// Public Interface
|
|
332
|
+
//------------------------------------------------------------------------------
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* Encapsulates all CLI behavior for eslint. Makes it easier to test as well as
|
|
336
|
+
* for other Node.js programs to effectively run the CLI.
|
|
337
|
+
*/
|
|
338
|
+
const cli = {
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* Calculates the command string for the --inspect-config operation.
|
|
342
|
+
* @param {string} configFile The path to the config file to inspect.
|
|
343
|
+
* @param {boolean} hasUnstableTSConfigFlag `true` if the `unstable_ts_config` flag is enabled, `false` if it's not.
|
|
344
|
+
* @returns {Promise<string>} The command string to execute.
|
|
345
|
+
*/
|
|
346
|
+
async calculateInspectConfigFlags(configFile, hasUnstableTSConfigFlag) {
|
|
347
|
+
|
|
348
|
+
// find the config file
|
|
349
|
+
const {
|
|
350
|
+
configFilePath,
|
|
351
|
+
basePath,
|
|
352
|
+
error
|
|
353
|
+
} = await locateConfigFileToUse({ cwd: process.cwd(), configFile }, hasUnstableTSConfigFlag);
|
|
354
|
+
|
|
355
|
+
if (error) {
|
|
356
|
+
throw error;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
return ["--config", configFilePath, "--basePath", basePath];
|
|
360
|
+
},
|
|
361
|
+
|
|
362
|
+
/**
|
|
363
|
+
* Executes the CLI based on an array of arguments that is passed in.
|
|
364
|
+
* @param {string|Array|Object} args The arguments to process.
|
|
365
|
+
* @param {string} [text] The text to lint (used for TTY).
|
|
366
|
+
* @param {boolean} [allowFlatConfig=true] Whether or not to allow flat config.
|
|
367
|
+
* @returns {Promise<number>} The exit code for the operation.
|
|
368
|
+
*/
|
|
369
|
+
async execute(args, text, allowFlatConfig = true) {
|
|
370
|
+
if (Array.isArray(args)) {
|
|
371
|
+
debug("CLI args: %o", args.slice(2));
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
/*
|
|
375
|
+
* Before doing anything, we need to see if we are using a
|
|
376
|
+
* flat config file. If so, then we need to change the way command
|
|
377
|
+
* line args are parsed. This is temporary, and when we fully
|
|
378
|
+
* switch to flat config we can remove this logic.
|
|
379
|
+
*/
|
|
380
|
+
|
|
381
|
+
const usingFlatConfig = allowFlatConfig && await shouldUseFlatConfig();
|
|
382
|
+
|
|
383
|
+
debug("Using flat config?", usingFlatConfig);
|
|
384
|
+
|
|
385
|
+
if (allowFlatConfig && !usingFlatConfig) {
|
|
386
|
+
process.emitWarning("You are using an eslintrc configuration file, which is deprecated and support will be removed in v10.0.0. Please migrate to an eslint.config.js file. See https://eslint.org/docs/latest/use/configure/migration-guide for details.", "ESLintRCWarning");
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
const CLIOptions = createCLIOptions(usingFlatConfig);
|
|
390
|
+
|
|
391
|
+
/** @type {ParsedCLIOptions} */
|
|
392
|
+
let options;
|
|
393
|
+
|
|
394
|
+
try {
|
|
395
|
+
options = CLIOptions.parse(args);
|
|
396
|
+
} catch (error) {
|
|
397
|
+
debug("Error parsing CLI options:", error.message);
|
|
398
|
+
|
|
399
|
+
let errorMessage = error.message;
|
|
400
|
+
|
|
401
|
+
if (usingFlatConfig) {
|
|
402
|
+
errorMessage += "\nYou're using eslint.config.js, some command line flags are no longer available. Please see https://eslint.org/docs/latest/use/command-line-interface for details.";
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
log.error(errorMessage);
|
|
406
|
+
return 2;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
const files = options._;
|
|
410
|
+
const useStdin = typeof text === "string";
|
|
411
|
+
|
|
412
|
+
if (options.help) {
|
|
413
|
+
log.info(CLIOptions.generateHelp());
|
|
414
|
+
return 0;
|
|
415
|
+
}
|
|
416
|
+
if (options.version) {
|
|
417
|
+
log.info(RuntimeInfo.version());
|
|
418
|
+
return 0;
|
|
419
|
+
}
|
|
420
|
+
if (options.envInfo) {
|
|
421
|
+
try {
|
|
422
|
+
log.info(RuntimeInfo.environment());
|
|
423
|
+
return 0;
|
|
424
|
+
} catch (err) {
|
|
425
|
+
debug("Error retrieving environment info");
|
|
426
|
+
log.error(err.message);
|
|
427
|
+
return 2;
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
if (options.printConfig) {
|
|
432
|
+
if (files.length) {
|
|
433
|
+
log.error("The --print-config option must be used with exactly one file name.");
|
|
434
|
+
return 2;
|
|
435
|
+
}
|
|
436
|
+
if (useStdin) {
|
|
437
|
+
log.error("The --print-config option is not available for piped-in code.");
|
|
438
|
+
return 2;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
const engine = usingFlatConfig
|
|
442
|
+
? new ESLint(await translateOptions(options, "flat"))
|
|
443
|
+
: new LegacyESLint(await translateOptions(options));
|
|
444
|
+
const fileConfig =
|
|
445
|
+
await engine.calculateConfigForFile(options.printConfig);
|
|
446
|
+
|
|
447
|
+
log.info(JSON.stringify(fileConfig, null, " "));
|
|
448
|
+
return 0;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
if (options.inspectConfig) {
|
|
452
|
+
|
|
453
|
+
log.info("You can also run this command directly using 'npx @eslint/config-inspector@latest' in the same directory as your configuration file.");
|
|
454
|
+
|
|
455
|
+
try {
|
|
456
|
+
const flatOptions = await translateOptions(options, "flat");
|
|
457
|
+
const spawn = require("cross-spawn");
|
|
458
|
+
const flags = await cli.calculateInspectConfigFlags(flatOptions.overrideConfigFile, flatOptions.flags ? flatOptions.flags.includes("unstable_ts_config") : false);
|
|
459
|
+
|
|
460
|
+
spawn.sync("npx", ["@eslint/config-inspector@latest", ...flags], { encoding: "utf8", stdio: "inherit" });
|
|
461
|
+
} catch (error) {
|
|
462
|
+
log.error(error);
|
|
463
|
+
return 2;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
return 0;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
debug(`Running on ${useStdin ? "text" : "files"}`);
|
|
470
|
+
|
|
471
|
+
if (options.fix && options.fixDryRun) {
|
|
472
|
+
log.error("The --fix option and the --fix-dry-run option cannot be used together.");
|
|
473
|
+
return 2;
|
|
474
|
+
}
|
|
475
|
+
if (useStdin && options.fix) {
|
|
476
|
+
log.error("The --fix option is not available for piped-in code; use --fix-dry-run instead.");
|
|
477
|
+
return 2;
|
|
478
|
+
}
|
|
479
|
+
if (options.fixType && !options.fix && !options.fixDryRun) {
|
|
480
|
+
log.error("The --fix-type option requires either --fix or --fix-dry-run.");
|
|
481
|
+
return 2;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
if (options.reportUnusedDisableDirectives && options.reportUnusedDisableDirectivesSeverity !== void 0) {
|
|
485
|
+
log.error("The --report-unused-disable-directives option and the --report-unused-disable-directives-severity option cannot be used together.");
|
|
486
|
+
return 2;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
const ActiveESLint = usingFlatConfig ? ESLint : LegacyESLint;
|
|
490
|
+
const eslintOptions = await translateOptions(options, usingFlatConfig ? "flat" : "eslintrc");
|
|
491
|
+
const engine = new ActiveESLint(eslintOptions);
|
|
492
|
+
let results;
|
|
493
|
+
|
|
494
|
+
if (useStdin) {
|
|
495
|
+
results = await engine.lintText(text, {
|
|
496
|
+
filePath: options.stdinFilename,
|
|
497
|
+
|
|
498
|
+
// flatConfig respects CLI flag and constructor warnIgnored, eslintrc forces true for backwards compatibility
|
|
499
|
+
warnIgnored: usingFlatConfig ? void 0 : true
|
|
500
|
+
});
|
|
501
|
+
} else {
|
|
502
|
+
results = await engine.lintFiles(files);
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
if (options.fix) {
|
|
506
|
+
debug("Fix mode enabled - applying fixes");
|
|
507
|
+
await ActiveESLint.outputFixes(results);
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
let resultsToPrint = results;
|
|
511
|
+
|
|
512
|
+
if (options.quiet) {
|
|
513
|
+
debug("Quiet mode enabled - filtering out warnings");
|
|
514
|
+
resultsToPrint = ActiveESLint.getErrorResults(resultsToPrint);
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
const resultCounts = countErrors(results);
|
|
518
|
+
const tooManyWarnings = options.maxWarnings >= 0 && resultCounts.warningCount > options.maxWarnings;
|
|
519
|
+
const resultsMeta = tooManyWarnings
|
|
520
|
+
? {
|
|
521
|
+
maxWarningsExceeded: {
|
|
522
|
+
maxWarnings: options.maxWarnings,
|
|
523
|
+
foundWarnings: resultCounts.warningCount
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
: {};
|
|
527
|
+
|
|
528
|
+
if (await printResults(engine, resultsToPrint, options.format, options.outputFile, resultsMeta)) {
|
|
529
|
+
|
|
530
|
+
// Errors and warnings from the original unfiltered results should determine the exit code
|
|
531
|
+
const shouldExitForFatalErrors =
|
|
532
|
+
options.exitOnFatalError && resultCounts.fatalErrorCount > 0;
|
|
533
|
+
|
|
534
|
+
if (!resultCounts.errorCount && tooManyWarnings) {
|
|
535
|
+
log.error(
|
|
536
|
+
"ESLint found too many warnings (maximum: %s).",
|
|
537
|
+
options.maxWarnings
|
|
538
|
+
);
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
if (shouldExitForFatalErrors) {
|
|
542
|
+
return 2;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
return (resultCounts.errorCount || tooManyWarnings) ? 1 : 0;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
return 2;
|
|
549
|
+
}
|
|
550
|
+
};
|
|
551
|
+
|
|
552
|
+
module.exports = cli;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Default configuration
|
|
3
|
+
* @author Nicholas C. Zakas
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
"use strict";
|
|
7
|
+
|
|
8
|
+
//-----------------------------------------------------------------------------
|
|
9
|
+
// Requirements
|
|
10
|
+
//-----------------------------------------------------------------------------
|
|
11
|
+
|
|
12
|
+
const Rules = require("../rules");
|
|
13
|
+
|
|
14
|
+
//-----------------------------------------------------------------------------
|
|
15
|
+
// Helpers
|
|
16
|
+
//-----------------------------------------------------------------------------
|
|
17
|
+
|
|
18
|
+
exports.defaultConfig = [
|
|
19
|
+
{
|
|
20
|
+
plugins: {
|
|
21
|
+
"@": {
|
|
22
|
+
|
|
23
|
+
languages: {
|
|
24
|
+
js: require("../languages/js")
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
/*
|
|
28
|
+
* Because we try to delay loading rules until absolutely
|
|
29
|
+
* necessary, a proxy allows us to hook into the lazy-loading
|
|
30
|
+
* aspect of the rules map while still keeping all of the
|
|
31
|
+
* relevant configuration inside of the config array.
|
|
32
|
+
*/
|
|
33
|
+
rules: new Proxy({}, {
|
|
34
|
+
get(target, property) {
|
|
35
|
+
return Rules.get(property);
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
has(target, property) {
|
|
39
|
+
return Rules.has(property);
|
|
40
|
+
}
|
|
41
|
+
})
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
language: "@/js",
|
|
45
|
+
languageOptions: {
|
|
46
|
+
sourceType: "module",
|
|
47
|
+
ecmaVersion: "latest",
|
|
48
|
+
parser: require("espree"),
|
|
49
|
+
parserOptions: {}
|
|
50
|
+
},
|
|
51
|
+
linterOptions: {
|
|
52
|
+
reportUnusedDisableDirectives: 1
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
// default ignores are listed here
|
|
57
|
+
{
|
|
58
|
+
ignores: [
|
|
59
|
+
"**/node_modules/",
|
|
60
|
+
".git/"
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
// intentionally empty config to ensure these files are globbed by default
|
|
65
|
+
{
|
|
66
|
+
files: ["**/*.js", "**/*.mjs"]
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
files: ["**/*.cjs"],
|
|
70
|
+
languageOptions: {
|
|
71
|
+
sourceType: "commonjs",
|
|
72
|
+
ecmaVersion: "latest"
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
];
|